//
//  FirstViewController.m
//  录音
//
//  Created by ywy on 2016/12/22.
//  Copyright © 2016年 Wely. All rights reserved.
//

#import "FirstViewController.h"
#import "InTheRecordingViewController.h"
#import "RETabBarViewController.h"
#import "RECheckLogin.h"
#import "RELoginViewController.h"



@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    RETabBarViewController * tabBar = (RETabBarViewController *)self.tabBarController;
    //自定义隐藏Tabbar
    [tabBar HideTabarView:NO];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:[UIImage imageNamed:@"标题阴影"]];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    if ([RECheckLogin checkLogin] == YES) {
//        RETabBarViewController * rootVC = [[RETabBarViewController alloc] init];
//        self.window.rootViewController = rootVC;
//    }else
//    {
//        RELoginViewController * rootVC = [[RELoginViewController alloc] init];
//        self.window.rootViewController = rootVC;
//    }

    [self creatBaseView];
    // Do any additional setup after loading the view.
}
-(void)creatBaseView
{
    UIButton * startButton = [UIButton buttonWithType:UIButtonTypeSystem];
    startButton.frame = CGRectMake(REScreenW/2-98.5, 150, 195, 192.75);
    [startButton addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    [startButton setBackgroundImage:[UIImage imageNamed:@"start"] forState:0];
    [startButton setBackgroundImage:[UIImage imageNamed:@"press"] forState:UIControlStateSelected];
    [self.view addSubview:startButton];
}
-(void)btnClick:(UIButton*)btn
{
    
    InTheRecordingViewController * InTheReVC = [[InTheRecordingViewController alloc] init];
    [self.navigationController pushViewController:InTheReVC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
